#!/anaconda3/envs/Script/bin python3.8
# -*- coding: utf-8 -*-
# ---
# @Software: PyCharm
# @File: restful_start.py
# @Author: AllenFu
# @Institution: NCHU, China
# @E-mail: nchufujianjian@126.com
# @Site: restful 模式启动
# @Time: 11月 27, 2020
# ---
from flask_cors import CORS
from flask_restful import Api

import environment
from app import app
from app.controller.restful_controller import TodoList

environment.init('restful')

flask_app = app
rest_api = Api(app=flask_app)
rest_api.add_resource(TodoList, '/todos')
CORS(app=flask_app, supports_credentials=True)
if __name__ == '__main__':
    flask_app.debug=False
    flask_app.run(host='0.0.0.0', port=1574)

